<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增采购单位验收合同')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-acceptancecontract-add">


            <div class="form-group">    
                <label class="col-sm-3 control-label">采购申报项目：</label>
                <div class="col-sm-8">

                    <select id="procurementDeclareId" name="procurementDeclareId" class="form-control" >
                        <option th:each="sysProcurementdeclare:${sysProcurementdeclareList}" th:value="${sysProcurementdeclare.procurementDeclareId}" th:text="${sysProcurementdeclare.projectName}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">供货合同编号：</label>
                <div class="col-sm-8">
                    <select id="provideContractId" name="provideContractId" class="form-control" >
                        <option th:each="sysProvidecontract:${sysProvidecontractList}" th:value="${sysProvidecontract.provideContractId}" th:text="${sysProvidecontract.contractNumber}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">协议供货价(元)：</label>
                <div class="col-sm-8">
                    <dl id="showdiv">
                        <dt>货物质量评分：</dt>
                        <dd id="zhiliangpinfeng">
                            <span id="zhiliang1" onmouseover="zhiliang('1')" onmouseout="zhiliangclear()" onmousedown="zhiliangdanji('1')">☆</span>
                            <span id="zhiliang2" onmouseover="zhiliang('2')" onmouseout="zhiliangclear()" onmousedown="zhiliangdanji('2')">☆</span>
                            <span id="zhiliang3" onmouseover="zhiliang('3')" onmouseout="zhiliangclear()" onmousedown="zhiliangdanji('3')">☆</span>
                            <span id="zhiliang4" onmouseover="zhiliang('4')" onmouseout="zhiliangclear()" onmousedown="zhiliangdanji('4')">☆</span>
                            <span id="zhiliang5" onmouseover="zhiliang('5')" onmouseout="zhiliangclear()" onmousedown="zhiliangdanji('5')">☆</span>
                        </dd>
                    </dl>
                    <input type="hidden" name="attribute1" value="" id="zhiliang">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最终成交价(元)：</label>
                <div class="col-sm-8">
                    <dl id="showdiv">
                        <dt>服务态度评分：</dt>
                        <dd id="taidupinfeng">
                            <span id="taidu1" onmouseover="taidu('1')" onmouseout="taiduclear()" onmousedown="taidudanji('1')">☆</span>
                            <span id="taidu2" onmouseover="taidu('2')" onmouseout="taiduclear()" onmousedown="taidudanji('2')">☆</span>
                            <span id="taidu3" onmouseover="taidu('3')" onmouseout="taiduclear()" onmousedown="taidudanji('3')">☆</span>
                            <span id="taidu4" onmouseover="taidu('4')" onmouseout="taiduclear()" onmousedown="taidudanji('4')">☆</span>
                            <span id="taidu5" onmouseover="taidu('5')" onmouseout="taiduclear()" onmousedown="taidudanji('5')">☆</span>
                        </dd>
                    </dl>
                </div>
                <input type="hidden" name="attribute2" value="" id="taidu">
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">温馨提示：</label>
                <div class="col-sm-8">
                    <label style="width:70%;padding: 0px; color: red">打分标准：一星/非常不满意，两星/不满意，三星/基本满意，四星/满意，五星/非常满意</label>
                </div>
            </div>
             <div class="form-group">
                 <label class="col-sm-3 control-label">评价：</label>
                 <div class="col-sm-8">
                     <input name="attribute3" class="form-control" type="text">
                 </div>
             </div>
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">采购单位联系电话：</label>
                <div class="col-sm-8">
                    <input name="unitTel" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">追加资金(元)：</label>
                <div class="col-sm-8">
                    <input name="additionalMoney" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">供货商名称：</label>
                <div class="col-sm-8">
                    <input name="supplierName" class="form-control" type="text">
                </div>
            </div>-->
            <!--<div class="form-group">
                <label class="col-sm-3 control-label">负责人：</label>
                <div class="col-sm-8">
                    <input name="manager" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">供货商联系电话：</label>
                <div class="col-sm-8">
                    <input name="supplierPhone" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">验收结果：</label>
                <div class="col-sm-8">
                    <input name="acceptanceResult" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">验收成员：</label>
                <div class="col-sm-8">
                    <input name="acceptancePerson" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">付款金额小写(元)：</label>
                <div class="col-sm-8">
                    <input name="priceLowercase" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">金额大写：</label>
                <div class="col-sm-8">
                    <input name="priceChinese" class="form-control" type="text">
                </div>
            </div>-->

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/acceptancecontract"
        $("#form-acceptancecontract-add").validate({
            focusCleanup: true
        });


        function zhiliang(myvalue){
            for(var i=1;i<=5;i++){//将所有都变白星星
                document.getElementById("zhiliang"+i).innerHTML="☆";
                document.getElementById("zhiliang"+i).setAttribute("style","color:red");
            }
            for(var i=1;i<=myvalue;i++){//通过传入的id（也是一个数字）确定id以下的div都是红色星星。
                document.getElementById("zhiliang"+i).innerHTML="★";
                document.getElementById("zhiliang"+i).setAttribute("style","color:red");
            }
        }
        function zhiliangdanji(myvalue){
            for(var i=1;i<=5;i++){//将所有都变白星星
                document.getElementById("zhiliang"+i).innerHTML="☆";
                document.getElementById("zhiliang"+i).setAttribute("style","color:red");
            }
            for(var i=1;i<=myvalue;i++){//通过传入的id（也是一个数字）确定id以下的div都是红色星星。
                document.getElementById("zhiliang"+i).innerHTML="★";
                document.getElementById("zhiliang"+i).setAttribute("style","color:red");
                $("#zhiliang").val(i);
            }
        }
        function taidu(myvalue){
            for(var j=1;j<=5;j++){//将所有都变白星星
                document.getElementById("taidu"+j).innerHTML="☆";
                document.getElementById("taidu"+j).setAttribute("style","color:red");
            }
            for(var j=1;j<=myvalue;j++){//通过传入的id（也是一个数字）确定id以下的div都是红色星星。
                document.getElementById("taidu"+j).innerHTML="★";
                document.getElementById("taidu"+j).setAttribute("style","color:red");
            }
        }
        function taidudanji(myvalue){
            for(var j=1;j<=5;j++){//将所有都变白星星
                document.getElementById("taidu"+j).innerHTML="☆";
                document.getElementById("taidu"+j).setAttribute("style","color:red");
            }
            for(var j=1;j<=myvalue;j++){//通过传入的id（也是一个数字）确定id以下的div都是红色星星。
                document.getElementById("taidu"+j).innerHTML="★";
                document.getElementById("taidu"+j).setAttribute("style","color:red");
                $("#taidu").val(j);
            }
        }
        function zhiliangclear(){
            var zhiliang = $('#zhiliang').val();
            if(zhiliang == ""){
                zhiliang = 0;
            }
            for(var i=1;i<=5;i++){ //通过传入的id（也是一个数字）确定id以下的div都是红色星星。
                if(i<=zhiliang){
                    document.getElementById("zhiliang"+i).innerHTML="★";
                    document.getElementById("zhiliang"+i).setAttribute("style","color:red");
                    $("#zhiliang").val(i);
                }else{
                    document.getElementById("zhiliang"+i).innerHTML="☆";
                    document.getElementById("zhiliang"+i).setAttribute("style","color:red");
                }
            }
        }
        function taiduclear(){
            var taidu = $('#taidu').val();
            if(taidu == ""){
                taidu = 0;
            }
            for(var j=1;j<=5;j++){ //通过传入的id（也是一个数字）确定id以下的div都是红色星星。
                if(j<=taidu){
                    document.getElementById("taidu"+j).innerHTML="★";
                    document.getElementById("taidu"+j).setAttribute("style","color:red");
                    $("#taidu").val(j);
                }else{
                    document.getElementById("taidu"+j).innerHTML="☆";
                    document.getElementById("taidu"+j).setAttribute("style","color:red");
                }
            }
        }



        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-acceptancecontract-add').serialize());
            }
        }
    </script>
</body>
</html>